import { Service } from 'egg';
import prisma from '@/prisma';

export default class UserService extends Service {
  // private prisma = new PrismaClient();

  public async login({ account }: { account: string; password: string }) {
    const user = await prisma.tb_student.findFirst({
      where: {
        phone: account,
      },
    });

    return user;
  }

  public async getUserInfo(id: number) {
    const user = await prisma.tb_student.findFirst({
      where: {
        Id: id,
      },
    });

    return user;
  }
}
